﻿using System;
using System.Collections.Generic;

namespace PacketDotNet.Utils.Extension
{
    public static class ExtArray
    {
        public static bool SequenceEqual(this byte[] srcArray,byte[] dstArray)
        {
             if(srcArray.Length!=dstArray.Length)return false;
            unsafe
            {
                int index = srcArray.Length - 1;

                fixed(byte * src=srcArray,dst=dstArray)
                {
                    while(index>0)
                    {
                        if (*(src + index) != *(dst + index)) return false;
                        --index;
                    }
                }
            }
            return true;
        }
    }
}
